<blockquote class="layui-elem-quote" *ngIf="user">
  <div id="theform" lay-filter="FoodOrder" *ngIf="user.id!==1">
    <h2>订购食物</h2>
    <div>
      <form class="layui-form" lay-filter="foodaa">
        <div class="layui-form-item">
          <div class="layui-form-inline">
            <label class="layui-form-label">食物编号</label>
            <div class="layui-input-inline">
              <input type="text" name="name" required lay-verify="required" placeholder="请输入食物编号" autocomplete="off" class="layui-input"
                [(ngModel)]="foodId">
            </div>
          </div>
        </div>

        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo" (click)="createFoodOrder()">立即订购</button>
            <button type="reset" class="layui-btn layui-btn-primary" (click)="reset()">重置</button>
          </div>
        </div>
      </form>
    </div>
  </div>
  <table class="layui-table">
    <colgroup>
      <col width="150">
      <col width="200">
      <col width="80">
      <col width="400">
    </colgroup>
    <thead>
      <tr>
        <th>食物编号</th>
        <th>食物名称</th>
        <th>价格</th>
        <th>详细描述</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let food of foods">
        <td>{{food.id}}</td>
        <td>{{food.name}}</td>
        <td>{{food.price}}</td>
        <td>{{food.desc}}</td>
      </tr>
    </tbody>
  </table>
</blockquote>

<table class="layui-table">
  <colgroup>
    <col width="150">
    <col width="200">
    <col>
  </colgroup>
  <thead>
    <tr>
      <th>编号</th>
      <th>食物名</th>
      <th>房间名</th>
      <th>相关操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let foodOrder of foodOrders">
      <td *ngIf="foodOrder.status=='WAIT'">{{foodOrder.id}}</td>
      <td *ngIf="foodOrder.status=='WAIT'">{{foodOrder.foodId}}</td>
      <td *ngIf="foodOrder.status=='WAIT'">{{foodOrder.roomId}}</td>
      <td *ngIf="foodOrder.status=='WAIT'">
        <a class="layui-btn layui-btn-xs" (click)="complateFoodOrder(foodOrder)" *ngIf="foodOrder.status=='WAIT'">已配送</a>
      </td>
    </tr>
  </tbody>
</table>
